import pprint

person= [{'name':'zhangpp', 'height':'180', 'age':'27'}, {'name':'zpp', 'height':'185', 'age':'24'}]

fileObj = open('myName.py', 'w')
fileObj.write('person =' + pprint.pformat(person) + '\n')

fileObj.close()
